import java.util.Scanner;

public class ThirdQuestion {
    int age;

    public void buyTicket() {
        if (age < 18 || age >= 60 && age > 0) {
            System.out.println("门票全免");
        } else {
            System.out.println("门票20");
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ThirdQuestion thirdQuestion = new ThirdQuestion();
        while (true) {
            System.out.println("请输入年龄：");
            thirdQuestion.age = scanner.nextInt();
            thirdQuestion.buyTicket();
            System.out.println("是否继续（按n退出）");
            String N = scanner.next();
            if (N.equalsIgnoreCase("n")){
                System.out.println("谢谢使用");
                break;
            }
        }
    }
}
